import request from "@/utils/request";

// 查询参数列表
export function listConfig(query) {
  return request({
    url: "/api/system/config/list",
    method: "post",
    data: query,
  });
}

// 查询参数详细
export function getConfig(configId) {
  return request({
    url: "/api/system/config/getById?id=" + configId,
    method: "post",
  });
}

// 根据参数键名查询参数值
export function getConfigKey(configKey) {
  return request({
    url: "/api/system/config/getByKey?configKey=" + configKey,
    method: "post",
  });
}

// 新增参数配置
export function addConfig(data) {
  return request({
    url: "/api/system/config/insert",
    method: "post",
    data: data,
  });
}

// 修改参数配置
export function updateConfig(data) {
  return request({
    url: "/api/system/config/update",
    method: "post",
    data: data,
  });
}

// 删除参数配置
export function delConfig(data) {
  return request({
    url: "/api/system/config/delete",
    method: "post",
    data: data,
  });
}

// 刷新参数缓存
export function refreshCache() {
  return request({
    url: "/system/config/refreshCache",
    method: "delete",
  });
}

// 获取软件注册信息
export function getRegisterInfo() {
  return request({
    url: "/api/system/soft/getRegisterInfo",
    method: "post",
  });
}

// 软件注册
export function register(registerNo) {
  return request({
    url: "/api/system/soft/register?registerNo=" + registerNo,
    method: "post",
  });
}
